#include <iostream>

//https://www.nowcoder.com/practice/eb72dada09de43ceacf93f9a143ee321?tpId=225&tqId=2184168&ru=%2Fpractice%2Fb0423a89826c4d68a3e8b9832a6a1f49&qru=%2Fta%2Fprimary-grammar-cpp%2Fquestion-ranking&sourceUrl=https%3A%2F%2Fwww.nowcoder.com%2Fexam%2Foj

using namespace std;

int main() {
    int arr[6] = {0};
    int len = sizeof(arr) / sizeof(int);

    for (int i = 0; i < len; i++) {
        cin >> arr[i];
    }
    for (int i = 0; i < len - 1; i++) {
        //第i趟比较
        for (int j = 0; j < len - i - 1; j++) {
            //开始进行比较，如果arr[j]比arr[j+1]的值大，那就交换位置
            if (arr[j] > arr[j + 1]) {
                swap(arr[j], arr[j + 1]);
            }
        }
    }
    for (int i = 0; i < len; i++) //输出
        cout << arr[i] << " ";
    return 0;
}



